package testops.top.service;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Service;
import testops.top.dao.UserDao;

/**
 * 通过set方法实现注入
 */

@Service("userServiceImpl02")
@PropertySource("classpath:jdbc.properties")
public class UserServiceImpl02 implements UserService {
    @Autowired
    private UserDao userDao;

    @Value("${jdbc.driver}")
    private String driver;
    @Value("${jdbc.username}")
    private String username;

    public void save() {
        System.out.println(driver);
        System.out.println(username);
        userDao.save();
    }
}
